/**
 * VUEshop
 * ============================================================================
 * * 版权所有 2015-2027 深圳搜豹网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.vueshop.com.cn
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: soubao-java 2020-07-22 $
 */<template>
  <div>
    <div class="item-title">
      <div class="subject">
        <h3>会员协议</h3>
        <h5>网站会员协议设置管理</h5>
      </div>
    </div>
    <div
      id="explanation"
      class="explanation"
      style="color: rgb(85, 85, 85); background-color: rgb(243, 244, 244); width: 98%; height: 100%;"
    >
      <div class="bckopa-tips">
        <div class="title">
          <img src="@/static/images/handd.png" alt />
          <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
        </div>
        <ul>
          <li>在相关操作处可查看具体内容，例：在注册会员时须查看用户服务协议</li>
        </ul>
      </div>
      <span title="收起提示" id="explanationZoom" style="display: block;"></span>
    </div>
    <div class="mDiv">
      <div class="ftitle">
        <h3>会员协议列表</h3>
        <h5>(共 {{tableData.length}} 条记录)</h5>
      </div>
      <div class="fbutton">
        <div class="add" @click="toAdd()">
          <span>
            <i class="el-icon-circle-plus" /> 新增会员协议
          </span>
        </div>
      </div>
      <a href @click.prevent="refresh()" class="refresh-date">
        <div title="刷新数据" class="pReload">
          <i class="fa fa-refresh"></i>
        </div>
      </a>
    </div>

    <div class="tablebox">
      <el-table :data="tableData" ref="multipleTable" style="width: 100%;">
        <el-table-column label="标题" prop="doc_title" width="300"></el-table-column>
        <el-table-column label="时间" prop="doc_time_desc" width="300"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button-group>
              <el-button
                @click="toEdit(scope.row.doc_code)"
                icon="el-icon-edit-outline"
                size="small"
              >编辑</el-button>
            </el-button-group>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getSystemArticleList } from "@/utils/api";
export default {
  data() {
    return {
      tableData: []
    };
  },
  components: {},
  created() {
    this.getList();
  },
  methods: {
    getList() {
      var that = this;
      getSystemArticleList().then(function(res) {
        that.tableData = res;
      });
    },
    refresh() {
      this.getList();
      this.$message({
        type: "success",
        message: "刷新成功！"
      });
    },
    toAdd() {
      this.$router.push({
        name: "system_article_add"
      });
    },
    toEdit(id) {
      this.$router.push({
        name: "system_article_edit",
        params: {
          id: id
        }
      });
    }
  }
};
</script>

<style scoped>
</style>
